<template>
  <div class="pagebody"></div>
</template>
  <script>
// import VConsole from "vconsole";
import getUser from "@/api/getUserInfo1";
import { Loading } from "element-ui";

export default {
  name: "loading",
  data() {
    return {};
  },
  async mounted() {
    Loading.service();

    document.addEventListener("visibilitychange", function() { 
      if (document.visibilityState === "visible")  { 
        console.log("onShow"); 
        window.location.reload()
        // this.$router.push('/')

      } 
    });

    //const vConsole = new VConsole();
    await getUser.getUser();
    let istoken = window.localStorage.getItem("token");
    if (istoken) {
      this.$router.push("/");
    } else {
      getUser.onLoginApp();
    }
    let loadingInstance = Loading.service();
    this.$nextTick(() => {
      loadingInstance.close();
    });

    // vConsole.destroy();
  },
  methods: {},
};
</script>
  
  <style lang="scss" scoped>
.pagebody {
}
</style>